<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html>
<html>
<head>
	<title></title>

	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<!-- 引入bootstrap -->
	<link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="/css/bootstrap-datetimepicker.min.css">
	<link rel="stylesheet" type="text/css" href="/css/custom.css">
	<!-- 引入JQuery  bootstrap.js-->
	<script src="/js/jquery-3.2.1.min.js"></script>
	<script src="/js/bootstrap.min.js"></script>
	<script src="/js/bootstrap-datetimepicker.min.js"></script>
	<script src="/js/bootstrap-datetimepicker.zh-CN.js"></script>
</head>
<body>
	<!-- 顶栏 -->
	<jsp:include page="top.jsp"></jsp:include>
	<!-- 中间主体 -->
		<div class="container" id="content">
		<div class="row">
			<jsp:include page="menu.jsp"></jsp:include>
			<div class="col-md-10">
				<div class="panel panel-default">
					<div class="panel-title">
						<ol class="breadcrumb breadcrumbReset">
							<li><a href="/admin/userList">用户管理</a></li>
							<li class="active">新增用户</li>
						</ol>
					</div>
				    <div class="panel-body">
						<form class="form-horizontal" role="form" action="/admin/addUser" id="editfrom" method="post">
							  <div class="form-group">
							    <label for="userName" class="col-sm-2 control-label">用户名</label>
							    <div class="col-sm-10">
							      <input type="text" class="form-control" id="userName" name="userName" placeholder="请输入用户名"
								  <c:if test='${user!=null}'>
										 value="${user.userName}"
								  </c:if>>
							    </div>
							  </div>
							  <div class="form-group">
								<label for="role" class="col-sm-2 control-label" name="role">角色</label>
								<div class="col-sm-10">
									<select class="form-control" name="role">
										<c:forEach items="${roleList}" var="item">
											<option value="${item.role}">${item.roleName}</option>
										</c:forEach>
									</select>
								</div>
							  </div>
							  <div class="form-group">
								<label for="cardNo" class="col-sm-2 control-label">身份证号</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="cardNo" name="cardNo" placeholder="请输入身份证号"
									<c:if test='${user!=null}'>
										   value="${user.cardNo}"
									</c:if>>
								</div>
							  </div>
							  <div class="form-group">
								<label for="phone" class="col-sm-2 control-label">电话号码</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="phone" name="phone" placeholder="请输入电话号码"
									<c:if test='${user!=null}'>
										   value="${user.phone}"
									</c:if>>
								</div>
							  </div>
							  <div class="form-group">
							    <label class="col-sm-2 control-label">性别</label>
							    <div class="col-sm-10">
								    <label class="checkbox-inline">
									   	<input type="radio" name="gender" value="男" checked>男
									</label>
									<label class="checkbox-inline">
										<input type="radio" name="gender" value="女">女
									</label>
							    </div>
							  </div>
							  <div class="form-group">
							    <label for="birthday" class="col-sm-2 control-label">出生日期</label>
							    <div class="col-sm-10 input-group inputGroupReset">
									<input type='text' class="form-control" id="birthday" name="birthday"
									<c:if test='${user!=null}'>
										   value="${user.birthday}"
									</c:if>>
									<span class="input-group-addon">
										<span class="glyphicon glyphicon-calendar"></span>
									</span>
							    </div>
							  </div>
							  <div class="form-group">
								<label for="address" class="col-sm-2 control-label">地址</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="address" name="address" placeholder="请输入地址"
									<c:if test='${user!=null}'>
										   value="${user.address}"
									</c:if>>
								</div>
							  </div>
							  <div class="form-group">
								<label for="email" class="col-sm-2 control-label">邮箱</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="email" name="email" placeholder="请输入邮箱"
									<c:if test='${user!=null}'>
										   value="${user.email}"
									</c:if>>
								</div>
							  </div>
							  <div class="form-group" style="text-align: center">
								<button class="btn btn-default" type="submit">提交</button>
								<button class="btn btn-default" type="reset" onclick="location.href='/admin/userList'">取消</button>
							  </div>
						</form>
				    </div>
				    
				</div>

			</div>
		</div>
	</div>
	<div class="container" id="footer">
	<div class="row">
		<div class="col-md-12"></div>
	</div>
	</div>
</body>
	<script type="text/javascript">
		$("#nav li:nth-child(2)").addClass("active");
		$("#birthday").datetimepicker({
			forceParse: 0,//设置为0，时间不会跳转1899，会显示当前时间。
			format: 'yyyy-mm-dd',//显示格式
			startView:2,
			minView:2,
			maxView :2,
			language: 'zh-CN',
			autoclose: 1,//选择后自动关闭
		})
	</script>
</html>